//
//  MSPOPMainViewController.m
//  MSPopupsManager_Example
//
//  Created by zz on 25.6.24.
//  Copyright © 2024 huizhou.wang. All rights reserved.
//

#import "MSPOPMainViewController.h"
#import <MSPopupsManager/MSPopupManagerConfig.h>
#import "MSPopupImageView.h"
#import "MSPopupFileView.h"
#import "MSPopupsAloneView.h"

#import "MSPOPUPTestViewController.h"

@interface MSPOPMainViewController ()

@end

@implementation MSPOPMainViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"pop";
    
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    btn.frame = CGRectMake(100, 100, 100, 100);
    btn.backgroundColor = [UIColor redColor];
    [btn addTarget:self action:@selector(btnClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn];
    NSLog(@"================================");
}

-(void)btnClick {
    MSPopupConfigure * config = [[MSPopupConfigure alloc] init];
    config.dismissDuration = 4;
    config.priority = 200;
    config.cornerRadius = 8;
    config.onlyCountModel = YES;
    config.clickOutsideDismiss = YES;
    config.containerView = self.view;
    MSPopupImageView * view = [[MSPopupImageView alloc] init];
    [view setHandler:^{
        NSLog(@">>>>>>>>>>>>>>>>>>>>>");
    }];
    [MSPopupManager addPopup:view options:config];
    

    MSPopupConfigure * config1 = [[MSPopupConfigure alloc] init];
    config1.dismissDuration = 10;
    config1.onlyCountModel = YES;
    config1.clickOutsideDismiss = YES;
    config.containerView = self.view;
    config1.priority = 300;
    config1.cornerRadius = 8;
    MSPopupFileView * fileView = [[MSPopupFileView alloc] init];
    [fileView setHandler:^{
        MSPOPUPTestViewController * test = [[MSPOPUPTestViewController alloc] init];
        [self.navigationController pushViewController:test animated:YES];
    }];
    [MSPopupManager addPopup:fileView options:config1];
    
    
//    MSPopupConfigure * config2 = [[MSPopupConfigure alloc] init];
////    config2.dismissDuration = 10;
//    config2.clickOutsideDismiss = YES;
//    config2.priority = 400;
//    config2.cornerRadius = 8;
//    config2.circuitBreaker = YES;
//    MSPopupsAloneView * aloneView = [[MSPopupsAloneView alloc] init];
//    [MSPopupManager addPopup:aloneView options:config2];
    
    
}


@end
